﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace UTC_Project_Manager.Model.Infrastructure
{
    // Implement INotifyPropertyChanged to provide item change notifications.
    public class TaskItem : INotifyPropertyChanged
    {
        private string content;
        public string Content
        {
            get { return content; }
            set { if (value == content) return; content = value; OnPropertyChanged("Content"); }
        }

        private int indentation;
        public int Indentation
        {
            get { return indentation; }
            set { if (value == indentation) return; indentation = value; OnPropertyChanged("Indentation"); }
        }

        private bool isExpanded;
        public bool IsExpanded
        {
            get { return isExpanded; }
            set { if (value == isExpanded) return; isExpanded = value; OnPropertyChanged("IsExpanded"); }
        }

        private DateTime start;
        public DateTime Start
        {
            get { return start; }
            set { if (value == start) return; start = value; OnPropertyChanged("Start"); }
        }

        
        private TimeSpan effort;
        public TimeSpan Effort
        {
            get { return effort; }
            set { if (value == effort) return; effort = value; OnPropertyChanged("Effort"); }
        }

        
        private TimeSpan duration;
        public TimeSpan Duration
        {
            get { return duration; }
            set { if (value == duration) return; duration = value; OnPropertyChanged("Duration"); }
        }

        private DateTime finish;
        public DateTime Finish
        {
            get { return finish; }
            set { if (value == finish) return; finish = value; OnPropertyChanged("Finish"); }
        }

        private bool isMilestone;
        public bool IsMilestone
        {
            get { return isMilestone; }
            set { if (value == isMilestone) return; isMilestone = value; OnPropertyChanged("IsMilestone"); }
        }

        
        private TimeSpan completedEffort;
        public TimeSpan CompletedEffort
        {
            get { return completedEffort; }
            set { if (value == completedEffort) return; completedEffort = value; OnPropertyChanged("CompletedEffort"); }
        }

        private double completion;
        public double Completion
        {
            get { return completion; }
            set { if (value == completion) return; completion = value; OnPropertyChanged("Completion"); }
        }

        private bool isCompleted;
        public bool IsCompleted
        {
            get { return isCompleted; }
            set { if (value == isCompleted) return; isCompleted = value; OnPropertyChanged("IsCompleted"); }
        }

        private string assignmentsString;
        public string AssignmentsString
        {
            get { return assignmentsString; }
            set { if (value == assignmentsString) return; assignmentsString = value; OnPropertyChanged("AssignmentsString"); }
        }

        private string indexString;
        public string IndexString
        {
            get { return indexString; }
            set { if (value == indexString) return; indexString = value; OnPropertyChanged("IndexString"); }
        }

        private string predecessorsString;
        public string PredecessorsString
        {
            get { return predecessorsString; }
            set { if (value == predecessorsString) return; predecessorsString = value; OnPropertyChanged("PredecessorsString"); }
        }

        private double cost;
        public double Cost
        {
            get { return cost; }
            set { if (value == cost) return; cost = value; OnPropertyChanged("Cost"); }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }

        public override String ToString()
        {
            return content;
        }
    }
}
